//
//  BaseTableViewCell.m
//  ZBMainFramework
//
//  Created by apple on 2018/10/23.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "BaseTableViewCell.h"

@implementation BaseTableViewCell

+ (BaseTableViewCell *)cellWithTableView:(UITableView *)tableView
{
    NSString  *BaseTableViewCellID = [self registerIdentifier];
    BaseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:BaseTableViewCellID];
    if(cell == nil){
        if([self loadType] == BaseTableViewCellLoadType_Xib){
            cell = [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].firstObject;
        }else{
            cell = [[self alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:BaseTableViewCellID];
        }
    }
    return cell;
}

+ (BaseTableViewCellLoadType)loadType
{
    return BaseTableViewCellLoadType_Xib;
}
+ (NSString *)registerIdentifier;
{
    return [NSString stringWithFormat:@"%@ID",NSStringFromClass(self)];
}

+ (CGFloat)getTableViewCellHeight
{
    return 44;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;
}
@end
